not right in the head
Mentally unsound, as in
Physically, she's quite healthy for ninety, but we suspect she's not right in the head
. This usage was first recorded as
right in his wits
in 1662.